﻿using System;
using System.Collections.Generic;
using System.Text;
using BlueLotus7.MetaWeblogUtil.Contract.Interfaces;
using CookComputing.XmlRpc;

namespace BlueLotus7.MetaWeblogUtil.CnBlogs.Contract
{
    [XmlRpcMissingMapping(MappingAction.Ignore)]
    public class CnBlogsPost : IStandardBlogPost
    {
        public DateTime dateCreated { get; set; }
        public string description { get; set; }
        public string title { get; set; }
        public string[] categories { get; set; }
        public string permalink { get; set; }
        public int postid { get; set; }
        public string userid { get; set; }
        public Enclosure enclosure { get; set; }
        public string link { get; set; }
        public Source source { get; set; }
        public bool mt_allow_comments { get; set; }
        public bool mt_allow_pings { get; set; }
        public bool mt_convert_breaks { get; set; }
        public string mt_text_more { get; set; }
        public string mt_excerpt { get; set; }

        #region IStandardBlogPost members

        public string mt_keywords
        {
            get;
            set;
        }

        public string wp_slug
        {
            get;
            set;
        }

        public string mt_basename
        {
            get;
            set;
        }

        public string wp_author_id
        {
            get;
            set;
        }

        public bool IsPublished
        {
            get;
            set;
        }

        #endregion

        public string PostId
        {
            get
            {
                return this.postid.ToString();
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    this.postid = Convert.ToInt32(value);
                }
            }
        }

        public DateTime DateCreated
        {
            get
            {
                return Convert.ToDateTime(this.dateCreated);
            }
            set
            {
                this.dateCreated = value;
            }
        }
    }

}
